<div class="span12">
<%= link_to "返回餐厅首页","/admin/restaurants/#{@restaurant.id}",class:"btn btn-info pull-right" %>
  <%= link_to "新增打印机","/admin/restaurants/#{@restaurant.id}/printers/new",class:"btn btn-success pull-right" %>
  <h4 class="header"><%= "#{@restaurant.name}的打印机" %></h4>
  <% if flash[:notice] %>
      <div class="alert alert-success">
        <button type="button" data-dismiss="alert" class="close">×</button><strong>成功! </strong><%= flash[:notice] %>
      </div>
  <% end %>
  <table id="datatables" class="table table-bordered table-striped responsive">
    <thead>
    <tr>
      <th>名称(地点)</th>
      <th>打印机编号</th>
      <th>KEY</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <% @printers.each do |printer| %>
        <tr>
          <td><%= printer.name %></td>
          <td><%= printer.sn %></td>
          <td>
              <%= printer.key %>
          </td>
          <td>
              <%= link_to "修改商品","/admin/restaurants/#{@restaurant.id}/printers/#{printer.id}/edit",class:"btn btn-info" %>
              <%= link_to "删除商品","/admin/restaurants/#{@restaurant.id}/printers/#{printer.id}",method: :delete,class:"btn btn-danger",data:{confirm:"确定要删除吗?"} %>
          </td>
        </tr>
    <% end %>


    </tbody>
  </table>

</div>